package drds.global_transaction.resource_manager.undolog;

import java.io.Serializable;

import drds.global_transaction.resource_manager.model.Image;
import drds.global_transaction.resource_manager.model.TableMetaData;
import drds.global_transaction.resource_manager.sql_recognizer.SqlType;
import lombok.Getter;
import lombok.Setter;

public class UndoLog implements Serializable
{
	private static final long serialVersionUID = 1L;
	@Setter
	@Getter
	private SqlType sqlType;
	@Setter
	@Getter
	private String tableName;
	@Setter
	@Getter
	private Image beforeImage;
	@Setter
	@Getter
	private Image afterImage;

	public void setTableMeta(TableMetaData tableMetaData)
	{
		if (beforeImage != null)
		{
			beforeImage.setTableMetaData(tableMetaData);
		}
		if (afterImage != null)
		{
			afterImage.setTableMetaData(tableMetaData);
		}
	}

}
